package com.xh.bgc.services.userSearch;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xh.bgc.dao.MySearchMapper;
import com.xh.bgc.util.Mg5Test;

@Service
public class MySearchServicesImpl implements MySearchServices {

	@Autowired
	private MySearchMapper mapper;

	@Override
	public List<Map<String, Object>> mySearch() {
		List<Map<String, Object>> list = mapper.mySearch();
		return list;
	}

	@Override
	public List<Map<String, Object>> search(String phone, String password) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("phone", phone);
		map.put("password", Mg5Test.getMD5(password));
		List<Map<String, Object>> list = mapper.search(map);
		return list;
	}

	@Override
	public int upPassword(String phone, String password, String password1) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("phone", phone);
		map.put("password", Mg5Test.getMD5(password));
		map.put("password1", Mg5Test.getMD5(password1));
		
		return mapper.upPassword(map);
	}

}
